package com.mask.im.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mask.im.business.common.model.RestResponse;

/**
 * @className：IMCallService
 * @Description: 通话管理类
 * @Author：jian
 * @Date：2025/10/11 08:52
 */
public interface IMCallService {
    /**
     * 发起语音视频通话
     *
     * @param receiverId 接收人Id
     * @param type       0:语音通话,1:视频通话
     * @return
     */
    RestResponse<?> requestCall(Long receiverId, Integer type, String offer);

    /**
     * 接听语音视频通话
     *
     * @param sendId
     * @return
     */
    RestResponse<?> acceptCall(Long sendId, String answer);

    /**
     * 发起者主动取消通话
     *
     * @param receiverId
     * @return
     */
    RestResponse<?> cancelCall(Long receiverId);

    /**
     * 接收者拒绝通话
     *
     * @param sendId
     * @return
     */
    RestResponse<?> rejectCall(Long sendId);

    /**
     * 结束通话
     *
     * @param otherId
     * @return
     */
    RestResponse<?> endCall(Long otherId);

    /**
     * 同步candidate
     *
     * @param otherId
     * @param candidate
     * @return
     */
    RestResponse<?> sendSignaling(Long otherId, String candidate);

    /**
     * 心跳续期
     *
     * @param otherId
     * @return
     */
    RestResponse<?> heartbeat(Long otherId);

}
